package dat255.calendarclock.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;

/**
 * A view that paints a color
 * @author Gabriel Andersson
 *
 */
public class ColorVisualizer extends View {

	private static Paint paint = new Paint();
	public ColorVisualizer(Context context, AttributeSet attrs) {
		super(context, attrs);
		setWillNotDraw(false);
	}
	
	/**
	 * Sets the color to paint
	 * @param color the colo to set
	 */
	public void setColor(int color){
		paint.setColor(color);
		
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		canvas.drawRect(new Rect(0,0,this.getRight(),this.getBottom()), paint);
	}

}
